package cn.tedu.shoot;

import java.util.Random;

//小蜜蜂是飞行物
public class Bee extends FlyingObject implements Award{
	private int xSpeed =1;
	private int ySpeed =2;
	private int awardType;
	public Bee(){
		image =ShootGame.bee;
	    width =image.getWidth();
	    height =image.getHeight();
	    Random rand =new Random();
	    x =rand.nextInt(ShootGame.WIDTH-this.width);
	    y =-this.height;
	    awardType =rand.nextInt(2);
	}
	//重写，获取奖励类型
	public int getType(){
		return awardType;
	}
/**重写step走一步 */		
	public void step(){
		x+= xSpeed;
		y+= ySpeed;
		if(x<=0){
			xSpeed =1;
		}
		if(x>=ShootGame.WIDTH-this.width){
			xSpeed =-1;
		}
	}
/** 重写   是否越界*/
	public boolean outOfBounds(){
		return this.y>=ShootGame.HEIGHT;
	}

  
}
